package com.sinoglobal.wallet.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.sinoglobal.wallet.R;
import com.sinoglobal.wallet.api.RemoteImpl;
import com.sinoglobal.wallet.entity.W_CouponDetail;
import com.sinoglobal.wallet.entity.W_CouponInstrutionEntity;
import com.sinoglobal.wallet.task.MyAsyncTask;


public class W_CouponShuoMingActivity extends W_ShareAbstractActivity {
	
	private TextView wallet_coupon_shuoming,wallet_coupon_shuoming_txt2;
	private boolean isShowProgressDialog=true;

	@Override
	protected void onCreate(Bundle arg0) {
		super.onCreate(arg0);
		setContentView(R.layout.wallet_coupon_shuoming);
		mTemplateTitleText.setText("优惠券说明");
              wallet_coupon_shuoming = (TextView) findViewById(R.id.wallet_coupon_shuoming);
              wallet_coupon_shuoming_txt2 = (TextView) findViewById(R.id.wallet_coupon_shuoming_txt2);
              
              
//            /  wallet_coupon_shuoming.setText(R.string.wallet_coupon_instrution);
              getData();
	}
	
	private void getData() {
		MyAsyncTask<W_CouponInstrutionEntity> task = new MyAsyncTask<W_CouponInstrutionEntity>(isShowProgressDialog, this, true) {
			@Override
			public W_CouponInstrutionEntity before(Void... params) throws Exception {
				return RemoteImpl.getInstance().getCouponInstrution();
			}

			@Override
			public void after(W_CouponInstrutionEntity result) {
				if (result != null) {
						wallet_coupon_shuoming.setText(result.getCouponDesc());
						wallet_coupon_shuoming_txt2.setText(result.getCouponInfo());
				}else{
					showToast("获取数据失败，请重试！");
				}

			}

			@Override
			public void exception() {
			}
		};
		task.execute();
	}

}
